package top.wilbert.collegelink.classification.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import top.wilbert.collegelink.classification.dao.SchoolDao;
import top.wilbert.collegelink.classification.entity.SchoolEntity;
import top.wilbert.collegelink.classification.service.SchoolService;
import top.wilbert.collegelink.classification.vo.SchoolSimpleInfoVo;
import top.wilbert.collegelink.common.utils.PageUtils;
import top.wilbert.collegelink.common.utils.Query;


@Service("schoolService")
public class SchoolServiceImpl extends ServiceImpl<SchoolDao, SchoolEntity> implements SchoolService {

    @Autowired
    private SchoolDao schoolDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<SchoolEntity> page = this.page(
                new Query<SchoolEntity>().getPage(params),
                new QueryWrapper<SchoolEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<SchoolSimpleInfoVo> listSimpleInfo() {
        List<SchoolSimpleInfoVo> schoolSimpleInfoVos = schoolDao.listSimpleInfo();

        return schoolSimpleInfoVos;
    }

}